home *** CD-ROM | disk | FTP | other *** search
- 126
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- CopyFile
- --- RECORDSEPARATOR ---
- Platform:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Windows and Macintosh
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Description:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- baCopyFile copies a file.
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Usage:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Result = baCopyFile( SourceFile , DestFile , Overwrite )
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Arguments:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- String, String, String.
- --- RECORDSEPARATOR ---
- SourceFile is the file to copy.
- --- RECORDSEPARATOR ---
- DestFile is the name to copy it to.
- --- RECORDSEPARATOR ---
- Overwrite determines how the copy is done. Can be:
- --- RECORDSEPARATOR ---
- "Always"
- --- RECORDSEPARATOR ---
- always copies the file
- --- RECORDSEPARATOR ---
- "IfNewer"
- --- RECORDSEPARATOR ---
- copies the file if SourceFile is newer than DestFile
- --- RECORDSEPARATOR ---
- "IfNotExist"
- --- RECORDSEPARATOR ---
- copies only if DestFile does not already exist
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Returns:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Integer.
- --- RECORDSEPARATOR ---
- Returns 0 if the file was copied successfully, otherwise one of these:
- --- RECORDSEPARATOR ---
- 1
- --- RECORDSEPARATOR ---
- Invalid Source file name
- --- RECORDSEPARATOR ---
- 2
- --- RECORDSEPARATOR ---
- Invalid Dest file name
- --- RECORDSEPARATOR ---
- 3
- --- RECORDSEPARATOR ---
- Error reading the Source file
- --- RECORDSEPARATOR ---
- 4
- --- RECORDSEPARATOR ---
- Error writing the Dest file
- --- RECORDSEPARATOR ---
- 5
- --- RECORDSEPARATOR ---
- Couldn't create directory for Dest file
- --- RECORDSEPARATOR ---
- 6
- --- RECORDSEPARATOR ---
- Dest file exists
- --- RECORDSEPARATOR ---
- 7
- --- RECORDSEPARATOR ---
- Dest file is newer that Source f
- --- RECORDSEPARATOR ---
- ile
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Examples:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Director:
- --- RECORDSEPARATOR ---
- set OK = baCopyFile("c:\data\student.dat", "c:\data\backup\student.dat", "IfNewer")
- --- RECORDSEPARATOR ---
- Authorware:
- --- RECORDSEPARATOR ---
- OK := baCopyFile("c:\\data\\student.dat", "c:\\data\\backup\\student.dat", "IfNewer")
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- Notes:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- By default, this function will not overwrite an existing file if that file is marked as
- --- RECORDSEPARATOR ---
- read-only. However, by adding "+" to the "Always" and "IfNewer" options ( eg
- --- RECORDSEPARATOR ---
- "Always+" or "IfNewer+"), the files will be overwritten if they are read-only.
- --- RECORDSEPARATOR ---
- A return value of 6 (Dest file exists) can only be returned when Overwrite is
- --- RECORDSEPARATOR ---
- "IfNotExist".
- --- RECORDSEPARATOR ---
- A return value of 7 (Dest file is newer than Source file) can only be returned when
- --- RECORDSEPARATOR ---
- Overwrite is "IfNewer". The other return values can be returned for all Overwrite
- --- RECORDSEPARATOR ---
- options.
- --- RECORDSEPARATOR ---
- The "IfNewer" option operates as follows on
- --- RECORDSEPARATOR ---
- Windows
- --- RECORDSEPARATOR ---
- : if both files have internal
- --- RECORDSEPARATOR ---
- version numbers, then these numbers are used for comparison, otherwise the
- --- RECORDSEPARATOR ---
- dates of the two files are used for comparison. On
- --- RECORDSEPARATOR ---
- Macintosh
- --- RECORDSEPARATOR ---
- , only the file dates
- --- RECORDSEPARATOR ---
- are used for comparison.
- --- RECORDSEPARATOR ---
- The DestFile must contain the full name of the file, not just the name of the folder it
- --- RECORDSEPARATOR ---
- is being copied to.
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- See also:
- --- RECORDSEPARATOR ---
-
- --- RECORDSEPARATOR ---
- baCopyXFiles